package com.naruto.thinkmgr.web;

import com.naruto.thinkmgr.bean.Page;
import com.naruto.thinkmgr.bean.PageParm;
import com.naruto.thinkmgr.bean.Role;
import com.naruto.thinkmgr.bean.User;
import com.naruto.thinkmgr.service.RoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/role")
@Slf4j
public class RoleController {

    @Autowired
    private RoleService roleService ;

    @GetMapping("")
    public String list( Model model) {
        List<Role> roles =  this.roleService.queryAll();
        model.addAttribute("roles", roles);
        return "role/list";
    }
}
